home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
DATATYPE
/
SIMPEXP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-08-18
|
2KB
|
47 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; stream importing and exporting of data type contents
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBDAT, EFLIBIO;
var Text : TextObjectType;
Stream : FileStreamObjectType;
Index : word;
begin
Stream.Initialize ('RESOURCE.$$$', 1024); Stream.Create; { Create }
with Text do begin
Initialize;
AddText ('Borland Pascal with Objects 7.0 offers many new features,');
AddText ('including:');
AddText ('');
AddText ('o DOS protected-mode applications - Create DOS applications');
AddText (' that run in protected mode and gain access to all available');
AddText (' extended memory (up to 16 MB).');
WriteLn ('* Exported text to a stream *');
StreamExport (@Stream);
Intercept;
end;
{ Go to first position in stream before reading }
Stream.Seek (0);
with Text do begin
Initialize;
StreamImport (@Stream, 6);
WriteLn ('* Imported text from a stream *');
for Index := 1 to Elements do WriteLn ('':2, Text(Index));
Intercept;
end;
Stream.Intercept;
if DeleteFile ('RESOURCE.$$$') then WriteLn ('* Done *');
if GlobalDataError then WriteLn ('Error(s) reported!');
end.